#include "BasicDebug.h"

namespace jcrada {
    double BasicDebug::SEQUENCE = 0.0;

    void BasicDebug::debug( double init_value ) {
        if (init_value >= 0.0) {
            SEQUENCE = init_value;
        }
#ifdef DEBUG_TO_LOG
        LOGP(TO_STRING(SEQUENCE++));
#else
        std::cout << SEQUENCE++ << std::endl;
#endif
    }

    void BasicDebug::debug( const QString& message, double init_value ) {
        if (init_value >= 0.0) {
            SEQUENCE = init_value;
        }
#ifdef DEBUG_TO_LOG
        LOGP(TO_STRING(SEQUENCE++) + " : " + message.toStdString());
#else
        std::cout << SEQUENCE++ << " : " << message.toStdString() << std::endl;
#endif
    }

    void BasicDebug::debug( const std::string& message, double init_value ) {
        if (init_value >= 0.0) {
            SEQUENCE = init_value;
        }
#ifdef DEBUG_TO_LOG
        LOGP(TO_STRING(SEQUENCE++) + " : " + message);
#else
        std::cout << SEQUENCE++ << " : " << message << std::endl;
#endif
    }

    int BasicDebug::main( int argc, char** argv ) {
        (void)argc; (void)argv;
        BDEBUG("Esto es un mensaje");
        DEBUGM;
        BDEBUG("Esto es otro mensaje");
        DEBUGM;
        BDEBUG("Esto es un mensaje?");
        DEBUGM;
        std::string fk(__FILE__);
        std::string kx(__FILE__);
        //            std::string x (__LINE__);
        std::cout << fk + kx << std::endl;
        return 0;
    }
}
